< previous page page_349 next page >

Page 349
0349-01.jpg
Figure 11.16
Program Bezier drawing a Bezier curve.
Bezier Blending Functions
You can enter the equations representing ax, bx, and so forth into the equations for the finished Bezier curve X(t) = ax * t3 + bx * t2 + cx * t + dx and Y(t) = ay * t3 + by * t2 + cy * t + dy. You can rearrange these equations to group together terms that involve the endpoints and control points.
e10a6a0a59f035e870d90cca05b85fce.gif
X(t)     =       (Ex2 - Ex1 - 3 * x2 + 3 * x1) * t3 +
         (3 * E
x1 - 6 * x1 + 3 * x2) * t2 +
         (-3 * E
x1 + 3 * x1 * t +
         E
x1
=        Ex1 * (-t3 + 3 * t2 - 3 * t + 1) +
         E
x2 * t3 +
         x
1 * (3 * t3 - 6 * t2 + 3 * t) +
         x
2 * (-3 * t3 = 3 * t2)
In this equation, the functions multiplying the values Ex1, Ex2, x1, and x2 terms are the blending functions for the Bezier curve. Like the blending functions for Hermite curves, they produce values for the points on the curve by blending different amounts of the control parameters as the value of t varies from 0 to 1.
Figure 11.17 shows the Bezier curve blending functions. Like the Hermite blending functions, all but one have value zero when t = 0 and when t = 1. The sum of these functions is 1 for any value of t. You many be able to see this from the picture, but it is easier to understand if you add the blending function equations together algebraically.
e10a6a0a59f035e870d90cca05b85fce.gif
(-t3 + 3 * t2 - 3 * t + 1) +
(t
3) +
(3 * t
3 - 6 * t2 + 3 * t) +

 
< previous page page_349 next page >